package com.oig.sys.file.api.fallback;

import com.oig.sys.file.api.FileUploadService;
import com.oig.sys.file.vo.UploadVo;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

@Slf4j
public class FileUploadServiceFallBackImpl implements FileUploadService {
    @Setter
    private Throwable cause;

    @Override
    public UploadVo upload(MultipartFile file) {
        log.error("feign upload error", cause);
        return null;
    }

    @Override
    public ResponseEntity<byte[]> download(String fileId) {
        log.error("feign download error", cause);
        log.error(fileId);
        return null;
    }

    @Override
    public String moveBucket(String fileId, String businessType, String relationType) {
        log.error("moveBucket error", cause);
        log.error(fileId);
        return null;
    }

    @Override
    public void removeFile(String fileId) {
        log.error("feign removeFile error", cause);
        log.error(fileId);
    }

    @Override
    public String getDownloadUrl(String fileId) {
        log.error("feign getDownloadUrl error", cause);
        log.error(fileId);
        return null;
    }
}
